package cn.bdqn.service.impl;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bdqn.dao.UsersDao;
import cn.bdqn.pojo.Users;
import cn.bdqn.service.UsersService;

@Service("userService")
public class UsersServiceImpl implements UsersService {

//注入dao接口
	@Autowired
	@Qualifier("userDao")
	private UsersDao usersDao;


	//登录
	@Transactional
	public Users doLogin(String userCode, String pwd) {

		Users users = usersDao.getUserByUcode(userCode);
		if(users!=null){//db内是存在此用户
			if(pwd!=null){
				if(users.getPwd().equals(pwd)){
					return  users;
				}
			}

		}

		return null;
	}


	


}
